package com.amit.hibernate;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;



public class CLab13 {

	public static void main(String[] args) {
		
	CandidateDAO cdao=DAOFactory.getCandidateDAO();
	
	//1.Adding fresh candidate
	
	List<String> emails=new ArrayList<String>();
	
	emails.add("aa@jlc");
	emails.add("bb@jlc");
		
	
	Map<String, Double> pers=new HashMap<String, Double>();
	pers.put("M.SC", new Double(99.99));
	pers.put("B.SC", new Double(88.88));
	
	FreshCandidate fc=new FreshCandidate("amit","yadav",emails,"M.SC","10-10-10",2010,pers,"yes");
	
	cdao.addCandidate(fc);
	
	//2.Adding ExpCandidate
	
	Set<String> sks=new HashSet<String>();
	sks.add("java");
	sks.add("jdbc");
	sks.add("jsp");
	
	List<String> cms=new ArrayList<String>();
	cms.add("JLC1");
	cms.add("JLC2");
	cms.add("JLC3");
	
ExpCandidate ec=new ExpCandidate("anil","yadav",emails,"B.SC","10-10-10",2010,sks,cms,9.9);

cdao.addCandidate(ec);

/*
//3.Loding Fresh candidate
FreshCandidate fcan=(FreshCandidate) cdao.getCandiadteByCid(1);

System.out.println(fcan.getCid());
System.out.println(fcan.getFname());
System.out.println(fcan.getLname());
System.out.println(fcan.getQualification());
System.out.println(fcan.getEmails());
System.out.println(fcan.getDob());
System.out.println(fcan.getYop());
System.out.println(fcan.getYearGaps());
System.out.println(fcan.getPercentages());

System.out.println("hello amit yadav");

//4.Loding  Expcandidate
ExpCandidate ecan=(ExpCandidate) cdao.getCandiadteByCid(5);

System.out.println(ecan.getCid());
System.out.println(ecan.getFname());
System.out.println(ecan.getLname());
System.out.println(ecan.getQualification());
System.out.println(ecan.getEmails());
System.out.println(ecan.getDob());
System.out.println(ecan.getYoe());
System.out.println(ecan.getCompanies());
System.out.println(ecan.getCtc());
System.out.println(ecan.getSkills());


//5.delete freshcandidate
cdao.deleteCandidate(4);
System.out.println("deletion successfully");*/

/*
//5.delete expcandidate
cdao.deleteCandidate(9);
System.out.println(" successfully");

*/

/*
//6.updating freshcandidate

FreshCandidate fcan1=(FreshCandidate) cdao.getCandiadteByCid(1);
fcan1.setFname("ajay");
fcan1.setLname("yadav");
	cdao.updateCandidate(fcan1);
	System.out.println("update successfully");
	
	
	*/

//7.updating expcandidate
/*
ExpCandidate ecan1=(ExpCandidate) cdao.getCandiadteByCid(3);
ecan1.setFname("ss");
ecan1.setLname("dande");
	cdao.updateCandidate(ecan1);
	System.out.println("update successfully");
	*/
	

//9.loading all candiates
List<Candidate> cans=cdao.getAllCandidates();
for(Candidate c:cans)
{
	System.out.println(c.getCid()+" "+c.getFname());
	System.out.println("amit");
}

	
	}
	
	
	
	

}
